package com.mall.shopping.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.shopping.constants.ShoppingRetCode;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.xml.bind.ValidationException;

/**
 * @Author: 逍遥子
 * @Date: 2022/01/20/9:05
 * @Description:
 */
@NoArgsConstructor
@Data
public class SelectCartShopRequest extends AbstractRequest {

    private Long userId;
    private boolean checked;


    @Override
    public void requestCheck() throws ValidationException {
        if(userId == null || userId.intValue() == 0){
            throw new ValidationException(
                    ShoppingRetCode.PARAMETER_VALIDATION_FAILED.getCode(),
                    ShoppingRetCode.PARAMETER_VALIDATION_FAILED.getMessage()
            );
        }
    }
}
